
\documentclass{article}
\usepackage{pgfplots}
\usepackage{pgfplots.assert}

\begin{document}

\makeatletter
\def\subject{Something without argument.}

\pgfplotsutil@add@to@macro\subject{Something else}%

\def\expected{Something without argument.Something else}

\pgfplotsassertequalstoknoexpand{\expected}{\subject}{Fails without args.}%


\def\subject#1{Something with argument #1; should be fine.}

\pgfplotsutil@add@to@macro\subject{Something else}%

\def\expected#1{Something with argument #1; should be fine.Something else}

\pgfplotsassertequalstoknoexpand{\expected}{\subject}{Fails with args.}%


%\tracingmacros=2 \tracingcommands=2
\def\subject#1{Something with argument #1; should be fine.}

\pgfplotsutil@add@to@macro\subject{Something else: #1}%

\def\expected#1{Something with argument #1; should be fine.Something else: #1}

\pgfplotsassertequalstoknoexpand{\expected}{\subject}{Fails with args.}%



\def\subject#1#2{Something with arguments #1 and #2; should be fine.}

\pgfplotsutil@add@to@macro\subject{Something else}%

\def\expected#1#2{Something with arguments #1 and #2; should be fine.Something else}

\pgfplotsassertequalstoknoexpand{\expected}{\subject}{Fails with 2 args.}%

OK.

\end{document}
